<template>
  <div>
    <h1 ref="hh">{{msg}}</h1>
    <button @click="change">改msg</button>
  </div>
</template>

<script>
export default {
  data() {
    return {
      msg:'你好世界',

    };
  },
  methods: {
    change() {
      this.msg ='HEELO WORID',
      // console.log(this.$refs.hh.innerHTML);
      // Vue 数据修改后 DOM更新后是异步的
      this.$nextTick(() => {
        console.log(this.$refs.hh.innerHTML);
      })
    }
  },
};
</script>

<style>

</style>